﻿@* 应用层树形服务 *@
@using Util.Generators.Helpers
@model Util.Generators.Contexts.EntityContext
@{
    var service = new GenerateService( Model );
    var entity = service.EntityName;
    var iApplicationService = service.GetIApplicationService();
    var applicationService = service.GetApplicationService();
    var unitOfWork = service.GetIUnitOfWork();
    var repository = $"I{entity}Repository";
    var query = $"{entity}Query";
    var description = $"{Model.Description}服务";
}
using @service.GetDomainNamespace( "Models" );
using @service.GetDomainNamespace( "Repositories" );
using @service.GetDataNamespace();
using @service.GetApplicationNamespace("Services.Abstractions",true);
using @service.GetApplicationNamespace("Dtos",true);
using @service.GetDataNamespace("Queries",true);

namespace @service.GetApplicationNamespace( "Services.Implements",true );

/// <summary>
/// @description
/// </summary>
public class @applicationService : @service.GetTreeServiceBase(), @iApplicationService {
    /// <summary>
    /// 初始化@(description)
    /// </summary>
    /// <param name="serviceProvider">服务提供器</param>
    /// <param name="unitOfWork">工作单元</param>
    /// <param name="repository">仓储</param>
    public @(applicationService)( IServiceProvider serviceProvider,@unitOfWork unitOfWork, @repository repository ) : base( serviceProvider,unitOfWork,repository ) {
    }

    /// <inheritdoc />
    protected override IQueryable<@entity> Filter( IQueryable<@entity> queryable, @query param ) {
        return @service.GetQueryableFilter();
    }
}